import React from 'react';
import {useNavigate} from "react-router-dom";

function My(props) {
    const navigate = useNavigate()
    return (
        <div>
            <h3>个人中心</h3>
            <h2>欢迎{localStorage.getItem('token')}登录~</h2>
            <button onClick={()=>{navigate('/login');localStorage.removeItem('token')}}>退出登录</button>
        </div>
    );
}

export default My;